<html>

<head>
    <title>FlvTest</title>

</head>

<script src="flv.js"></script>

<body>
<!--<button onclick="goLoad()">Load</button>-->
	<video id="videoElement0" height="300px" width="450px"></video>
	<video id="videoElement1" height="300px" width="450px"></video>
	<video id="videoElement2" height="300px" width="450px"></video>
	<video id="videoElement3" height="300px" width="450px"></video>
	<video id="videoElement4" height="300px" width="450px"></video>
	<video id="videoElement5" height="300px" width="450px"></video>
	<video id="videoElement6" height="300px" width="450px"></video>
	<video id="videoElement7" height="300px" width="450px"></video>
	<video id="videoElement8" height="300px" width="450px"></video>
	<video id="videoElement9" height="300px" width="450px"></video>
	<video id="videoElement10" height="300px" width="450px"></video>
	<video id="videoElement11" height="300px" width="450px"></video>

</body>


<script>
	// 谷歌浏览器最大同源请求数量是6
    var flvPlayer;
    // function goLoad() {
    //     console.log("load click!");
    //     console.log("mse live support:" + flvjs.getFeatureList().mseLiveFlvPlayback);

        if (flvjs.isSupported()) {
			var videoElement0 = document.getElementById('videoElement0');
			console.log('videoElement'+0);
			var flvPlayer0 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+0,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer0.attachMediaElement(videoElement0);
			flvPlayer0.load();
			flvPlayer0.play();




			var videoElement1 = document.getElementById('videoElement1');
			console.log('videoElement'+1);
			var flvPlayer1 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+1,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer1.attachMediaElement(videoElement1);
			flvPlayer1.load();
			flvPlayer1.play();

			var videoElement2 = document.getElementById('videoElement2');
			console.log('videoElement'+2);
			var flvPlayer2 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+2,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer2.attachMediaElement(videoElement2);
			flvPlayer2.load();
			flvPlayer2.play();


			var videoElement3 = document.getElementById('videoElement3');
			console.log('videoElement'+3);
			var flvPlayer3 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+3,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer3.attachMediaElement(videoElement3);
			flvPlayer3.load();
			flvPlayer3.play();

			var videoElement4 = document.getElementById('videoElement4');
			console.log('videoElement'+4);
			var flvPlayer4 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+1,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer4.attachMediaElement(videoElement4);
			flvPlayer4.load();
			flvPlayer4.play();


			var videoElement5 = document.getElementById('videoElement5');
			console.log('videoElement'+5);
			var flvPlayer5 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://localhost:18082/live/"+0,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer5.attachMediaElement(videoElement5);
			flvPlayer5.load();
			flvPlayer5.play();


			var videoElement6 = document.getElementById('videoElement6');
			console.log('videoElement'+6);
			var flvPlayer6 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+0,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer6.attachMediaElement(videoElement6);
			flvPlayer6.load();
			flvPlayer6.play();

			var videoElement7 = document.getElementById('videoElement7');
			console.log('videoElement'+7);
			var flvPlayer7 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+1,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer7.attachMediaElement(videoElement7);
			flvPlayer7.load();
			flvPlayer7.play();


			var videoElement8 = document.getElementById('videoElement8');
			console.log('videoElement'+8);
			var flvPlayer8 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+0,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer8.attachMediaElement(videoElement8);
			flvPlayer8.load();
			flvPlayer8.play();



			var videoElement9 = document.getElementById('videoElement9');
			console.log('videoElement'+9);
			var flvPlayer9 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+1,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer9.attachMediaElement(videoElement9);
			flvPlayer9.load();
			flvPlayer9.play();

			var videoElement10 = document.getElementById('videoElement10');
			console.log('videoElement'+10);
			var flvPlayer10 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+0,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer10.attachMediaElement(videoElement10);
			flvPlayer10.load();
			flvPlayer10.play();


			var videoElement11 = document.getElementById('videoElement11');
			console.log('videoElement'+11);
			var flvPlayer11 = flvjs.createPlayer({
				type: 'flv',
				isLive: true,
				url: "http://192.168.1.160:18082/live/"+1,
				duration: 0,
				filesize: 0,
				enableStashBuffer: false,
				hasAudio: false,
				hasVideo: true
			});
			flvPlayer11.attachMediaElement(videoElement11);
			flvPlayer11.load();
			flvPlayer11.play();


        // }
    }


</script>

</html>